// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import store from './store'
import iView from 'iview'
import 'iview/dist/styles/iview.css'
import App from './App'
import {router} from './router/index'
import api from './api/index.js'
import '@/assets/icons/iconfont.css'
import 'babel-polyfill'
import 'es6-promise/auto'
import promise from 'es6-promise'
import '@/my-theme/index.less'
import VueRouter from 'vue-router'
promise.polyfill()

Vue.config.productionTip = false
Vue.config.devtools = true

Vue.use(iView)

const routerPush = VueRouter.prototype.push
VueRouter.prototype.push = function push (location) {
	return routerPush.call(this, location).catch(error => error)
}
Vue.prototype.$api = api
/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  store,
  components: { App },
  template: '<App/>'
})
